package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoIdentity;
import com.sc.nft.entity.vo.AdminSimpleDaoIdentityVO;
import com.sc.nft.entity.vo.CatenaIdsGroupByCatenaVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * DAO身份表(sc_dao_identity)数据Mapper
 *
 * @author zxy
 * @description
 * @since 2023-10-20 00:56:41
 */
@Mapper
public interface DaoIdentityMapper extends BaseMapper<DaoIdentity> {

    BigDecimal getMaxRatio(@Param("daoId") Long daoId, @Param("userId") Long userId);

    List<CatenaIdsGroupByCatenaVO> selectByCatenaIdsGroupByCatena(@Param("ids") List<Long> ids);

    /**
     * 获取dao身份列表
     *
     * @param page
     * @param daoId
     * @param collectionName
     * @param identityName
     * @return
     */
    Page<AdminSimpleDaoIdentityVO> getSimpleDaoIdentityPage(Page page, @Param("daoId") Long daoId, @Param("collectionName") String collectionName, @Param("identityName") String identityName);

    /**
     * 根据daoId和藏品名称查询
     *
     * @param daoId
     * @param firstTitle
     * @return
     */
    Page<DaoIdentity> pageByDaoIdAndFirstTitle(Page page, @Param("daoId") Long daoId, @Param("firstTitle") String firstTitle);

}
